<?php
namespace application\models;

use system\core\Model;

class NewsModel extends Model
{
    public function __construct()
    {
        // We wanna use a different database for this Model. So we give the model
        // its own constructor and call the parent __construct() with the
        // database group as parameter.
        parent::__construct('database_2');
    }
    
    public function getNews()
    {
        // Now we do not get this data from the default database, but from 
        // the "g_framework_2" database.
        $this->db->orderBy('id DESC');
        return $this->db->get('news')->result();
    }
}